package com.hunk.springMvcExercise.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hunk.core.Constants;
@Controller
public class LoginViewController {
	/**跳转已定义的tile
	 * @return
	 */
	@RequestMapping(value="/loginView")
	public String easyRedirect(HttpServletRequest request,
			HttpServletResponse response, HttpSession session) {
		if (null != session.getAttribute(Constants.LOGIN_USERNAME.name())) {
			return "homeView";
		}
		return "loginView";
	}
}
